package com.futong.ft.server.test.fallback;

import com.futong.ft.common.entity.FTServerConstant;
import com.futong.ft.server.test.service.IHelloService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class HelloServiceFallback implements FallbackFactory<IHelloService> {

    @Override
    public IHelloService create(Throwable throwable) {
        return new IHelloService() {
            @Override
            public String hello(String name) {
                log.error("调用" + FTServerConstant.FT_SERVER_SYSTEM + "服务出错", throwable);
                return "调用出错";
            }
        };
    }

}
